<?php

class ManutencaoController extends Site_Controller_Action
{   

    public function init()
    {
        
        
    }
    
    public function minifyAction(){
        $this->_helper->layout->disableLayout(); 
        $this->_helper->viewRenderer->setNoRender();  
        
        Zend_Loader::loadClass('jsmin','library');
        
        $arr = array(
            'public/media/js/script.js' => 'public/media/js/script.min.js',
            'public/media/js/jquery.cycle.all.js' => 'public/media/js/jquery.cycle.min.js',
        );

        foreach ($arr as $arq => $novo_arq) {
            
            $js = JSMin::minify(file_get_contents($arq));
            
            file_put_contents($novo_arq, $js);
            chmod($novo_arq, 0755);
        }
        
        
        //Zend_Loader::loadClass('cssmin-v3.0.1','library');
        require_once 'library/cssmin-v3.0.1.php';
        
        $arr = array(
            'public/media/css/style.css' => 'public/media/css/style.min.css',
        );
        
        foreach ($arr as $arq => $novo_arq) {
            
            $css = CssMin::minify(file_get_contents($arq));
            
            file_put_contents($novo_arq, $css);
            chmod($novo_arq, 0755);
        }
        
    }
    
    
}

